import service from '@/utils/request';

export const getTrafficType = () =>
  service({
    url: `/simulation/res/trafficSimulation/type/`,
    method: 'get',
  });

export const getTrafficList = params =>
  service({
    url: `/simulation/res/trafficSimulation/`,
    method: 'get',
    params: params,
  });

export const createTraffic = data =>
  service({
    url: `/simulation/res/trafficSimulation/`,
    method: 'post',
    data,
  });

export const updateTraffic = (id, data) =>
  service({
    url: `/simulation/res/trafficSimulation/${id}/`,
    method: 'put',
    data,
  });

export const convertTraffic = (id, data) =>
  service({
    url: `/simulation/res/trafficSimulation/${id}/convert/`,
    method: 'post',
    data,
  });

export const delTraffic = id =>
  service({
    url: `/simulation/res/trafficSimulation/${id}/`,
    method: 'delete',
  });

export const generateTraffic = id =>
  service({
    url: `/simulation/res/trafficSimulation/${id}/generate/`,
    method: 'post',
  });

export const getResourceLibraryTrafficList = (params) =>
    service({
        url: `/simulation/resourceLibrary/traffic/`,
        method: 'get',
        params:params
    });
